<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">        
        <ui:define name="title">
            <h:outputText value="#{socio.NuevoSocio}"></h:outputText>
        </ui:define>
        <ui:define name="body">            
            <p:growl id="msgs" showDetail="true" sticky="true" />                
            <h:form id="frmCrearSocio" enctype="multipart/form-data">                
                <p:panel style=" background: white" header="Nuevo Socio">
                    <table width="100%" border="0" style="font-size: small">
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtRuc" value="#{socio.RUC}"/>
                            </th>
                            <td width="200px" align="left">
                                <p:inputText id="txtRuc" value="#{socioController.selected.ruc}" title="#{socio.RUC}" required="true" requiredMessage="#{socio.CampoRUC}" size="30"/>
                            </td>
                            <td align="left">
                                <p:message for="txtRuc" />
                            </td>
                            <td rowspan="7" align="center">
                                <div align="right">
                                    <p:graphicImage width="400" height="300" url="../img/ico/socio/nuevo.png"/>                                                                    
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th  align="right" scope="row">
                                <p:outputLabel for="txtNombres" value="#{socio.Nombres}"/>
                            </th>
                            <td  align="left">
                                <p:inputText id="txtNombres" value="#{socioController.selected.nombres}" title="#{socio.Nombres}" required="true" requiredMessage="#{socio.CampoNombres}" size="30"/>
                            </td>
                            <td><p:message for="txtNombres" /></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtApellidos" value="#{socio.Apellidos}"/>
                            </th>
                            <td align="left">
                                <p:inputText id="txtApellidos" value="#{socioController.selected.apellidos}" title="#{socio.Apellidos}" required="true" requiredMessage="#{socio.CampoApellidos}" size="30"/>
                            </td>
                            <td>
                                <p:message for="txtApellidos" />
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtDireccion" value="#{socio.Direccion}"/>
                            </th>
                            <td align="left">
                                <p:inputText id="txtDireccion" value="#{socioController.selected.direccion}" title="#{socio.Direccion}" size="30"/>
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtTelefono" value="#{socio.Telefono}"/>
                            </th>
                            <td align="left"><p:inputText id="txtTelefono" value="#{socioController.selected.telefono}" title="#{socio.Telefono}" size="30"/></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtCorreo" value="#{socio.Correo}"/>
                            </th>
                            <td align="left">
                                <p:inputText id="txtCorreo" value="#{socioController.selected.email}" title="#{socio.Correo}" size="30"/>
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel value="#{socio.Foto}"/>
                            </th>
                            <td align="left">
                                <p:fileUpload style="width: 90px" value="#{socioController.selected.file}" mode="simple" />
                            </td>
                        </tr>                        
                        <tr>                                
                            <th align="center" colspan="2" scope="row">
                                <p:commandButton ajax="false" action="#{socioController.crearSocio()}" value="Guardar"/>
                            </th>
                        </tr>
                        <tr>                                                            
                        </tr>    
                    </table>   
                    <div style="font-size: small" align="right">
                        * Campos Obligatorios
                    </div>
                    <div align="left" style="font-size: small">                        
                        <h:link outcome="index" value="#{socio.RegresarIndex}" />
                    </div> 
                </p:panel>                             
            </h:form>
        </ui:define>
    </ui:composition>
</html>

